/**
 * @名字: 移动端打开全文处理事件
 * @详情: 统一进行处理, id和fulltextSelect传一个参数即可
 * @参数: {id: 全文id, fulltextRow: 全文选择项, fulltextTableData: 全文表格数据 }
 * @返回值:
 */
import http from "@/api/index";
import { preType, imgType, videoType, audioType, ofdType } from "./contentType";
import router from "@/routers"; // 根据你的路由配置文件路径进行导入

export const previewFulltext = (data: any, proxy: any) => {
  const type = preType[data.AI_Source_Extension.toLowerCase()];
  if (!type) {
    proxy.$message.warning("该文件类型不可预览!");
    return;
  }
  http.get("MasterBaseAllInfos/AcquireFilePath", { AI_ID: data.AI_ID }, { noLoading: true }).then((res: any) => {
    if (res.Mark) {
      router.push({
        path: "/mobilePreview",
        query: {
          type: type,
          file: res.Model.Path,
          name: res.Model.FileName
        }
      });
    } else {
      proxy.$warning({
        title: "提示",
        content: res.Msg,
        zIndex: 5000
      });
    }
  });
};
